803831d0: 27 bd ff e8  ADDIU sp, sp, 0xffffffe8 (-24)

803831d4: 8c 8e 00 00  LW t6, a0, 0x0 (0)
803831d8: 85 cf 00 00  LH t7, t6, 0x0 (0)
803831dc: af af 00 14  SW t7, sp, 0x14 (20)              [sp + 0x14] = *arg1;

803831e0: 8c 98 00 00  LW t8, a0, 0x0 (0)
803831e4: 27 19 00 02  ADDIU t9, t8, 0x2 (2)
803831e8: ac 99 00 00  SW t9, a0, 0x0 (0)                *arg1 += 2;

803831ec: 8c 88 00 00  LW t0, a0, 0x0 (0)
803831f0: af a8 00 00  SW t0, sp, 0x0 (0)                [sp + 0x0] = *arg1;

803831f4: 8f aa 00 14  LW t2, sp, 0x14 (20)                t2 = [sp + 0x14]
803831f8: 8c 89 00 00  LW t1, a0, 0x0 (0)                  t1 = *arg1
803831fc: 00 0a 58 80  SLL t3, t2, 0x2 (2)                 t3 = t2*4 = [sp + 0x14]*4
80383200: 01 6a 58 23  SUBU t3, t3, t2                     t3 = t3-t2 = [sp + 0x14]*4 - [sp + 0x14] = [sp + 0x14]*3
80383204: 00 0b 60 40  SLL t4, t3, 0x1 (1)                 t4 = t3*2 = [sp + 0x14]*6
80383208: 01 2c 68 21  ADDU t5, t1, t4                     t5 = t1+t4 = *arg1 + [sp + 0x14]*6
8038320c: ac 8d 00 00  SW t5, a0, 0x0 (0)                *arg1 += [sp + 0x14]*6;

80383210: 10 00 00 03  BEQ r0, r0, 0x80383220 (pc + 0xc)
80383214: 8f a2 00 00  LW v0, sp, 0x0 (0)                return [sp + 0x0];
80383218: 10 00 00 01  BEQ r0, r0, 0x80383220 (pc + 0x4)
8038321c: 00 00 00 00  NOP
80383220: 03 e0 00 08  JR ra

/* returns pointer to virts */
void * 0x803831d0(short **pwp)
{
    short *rv; /* sp + 0x00 */
    int n;     /* sp + 0x14 -- number or virts */

    n = (int)(*pwp); /* load nbr of virts */
    *pwp++;
    rv = *pwp;
    *pwp += n*3;
    return rv;
}
